import request from '@/utils/request'

// 缺陷项统计 图表查询
export function getItemnFaultChart(query) {
    return request({
        url: '/ny-iqc/statistics/itemnFaultChart',
        method: 'post',
        params: query
    })
}

export function getItemFResultPie(query) {
    return request({
        url: '/ny-iqc/statistics/itemFResultPie',
        method: 'post',
        params: query
    })
}


// 缺陷项统计 列表查询
export function getItemFResultList(query) {
    return request({
        url: '/ny-iqc/statistics/itemFResultList',
        method: 'post',
        params: query
    })
}

// 物料缺陷统计 图表查询
export function getMaterialFaultChart(query) {
    return request({
        url: '/ny-iqc/statistics/materialFaultChart',
        method: 'post',
        params: query
    })
}

export function getMaterialFaultPie(query) {
    return request({
        url: '/ny-iqc/statistics/materialFResultPie',
        method: 'post',
        params: query
    })
}

// 物料缺陷统计 列表查询
export function getMaterialFResultList(query) {
    return request({
        url: '/ny-iqc/statistics/materialFResultList',
        method: 'post',
        params: query
    })
}
// 供应商缺陷统计 图表查询
export function getSupplierFaultChart(query) {
    return request({
        url: '/ny-iqc/statistics/supplierFaultChart',
        method: 'post',
        params: query
    })
}

export function getSupplierFaultPie(query) {
    return request({
        url: '/ny-iqc/statistics/supplierFaultResultPie',
        method: 'post',
        params: query
    })
}


// 供应商缺陷统计 列表查询
export function getSupplierFaultResultList(query) {
    return request({
        url: '/ny-iqc/statistics/supplierFaultResultList',
        method: 'post',
        params: query
    })
}

//<!-- 来料检验统计 -->

// 来料检验统计 列表查询1
export function getOneTimeQualifiedList(query) {
    return request({
        url: '/ny-iqc/statistics/oneTimeQualifiedList',
        method: 'post',
        params: query
    })
}

// 来料检验统计 列表查询2
export function getSMForOneTimeQualifiedListTwo(query) {
    return request({
        url: '/ny-iqc/statistics/SMForOneTimeQualifiedListTwo',
        method: 'post',
        params: query
    })
}

// 来料检验统计 图表 For一次合格率 图表
export function getOneTimeQualifiedChart(query) {
    return request({
        url: '/ny-iqc/statistics/oneTimeQualifiedChart',
        method: 'post',
        params: query
    })
}

// 来料检验统计 图表 For二次合格率 图表
export function getSMForTwoTimesQualifiedChart(query) {
    return request({
        url: '/ny-iqc/statistics/SMForTwoTimesQualifiedChart',
        method: 'post',
        params: query
    })
}

// 来料检验统计 图表 For 上线合格率 图表
export function getSMForQualificationChart(query) {
    return request({
        url: '/ny-iqc/statistics/SMForQualificationChart',
        method: 'post',
        params: query
    })
}

// 来料检验统计 图表 For 检验及时率  图表
export function getSMForCheckInTimeChart(query) {
    return request({
        url: '/ny-iqc/statistics/SMForCheckInTimeChart',
        method: 'post',
        params: query
    })
}

// 编辑上线不合格数量
export function editUnqualified(data) {
    return request({
        url: '/ny-iqc/incomingInspection',
        method: 'put',
        data
    })
}

// 导入项目分析
export function importAnalyse(data) {
    return request({
        url: '/ny-iqc/bomAnalyse/import',
        method: 'post',
        data
    })
}

export function supplierPpm(params) {
    return request({
        url: '/ipqc/statistic/supplierPpm',
        method: 'get',
        params
    })
}
